package com.study.json;

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.study.json.entity.Feature;

import java.io.FileNotFoundException;
import java.io.FileReader;

public class Gsonn {
    public static void main(String[] args) throws FileNotFoundException {
//        Gson gson = new Gson();
        Gson gson = new GsonBuilder().setPrettyPrinting().create();
        Feature feature = gson.fromJson(new FileReader("src/main/resources/feature.json"), Feature.class);

        gson.fromJson(new FileReader("src/main/resources/feature.json"), Feature.class);
        String fJson = gson.toJson(feature);
        System.out.println(fJson);
    }
}
